import { register } from '@antv/x6-vue-shape'
// import AMapC from '../barChart/components/BarChart.vue'
import AMapC from './components/AMapC.vue'
import { DataType } from '@yk/components/draw/shapes/type'

type DataOption = { dataType: 'gatewayDistribution' }
register({
  shape: 'AMapC',
  attrs: {
    body: {
      style: {
        borderStyle: 'solid',
        borderWidth: 0,
        borderColor: ''
      }
    }
  },
  component: AMapC,
  data: {
    dataConfig: {
      runModel: 'selfRun',
      echartsOptions: {
        legend: { show: true },
        tooltip: { show: true },
        toolbox: { show: false }
      },
      echartsConfig: {
        textColor: { color: '#000001' },
        splitLine: { color: '#EDEEF1' },
        area: {
          show: false,
          color1: '#5470C6',
          color2: null
        }
      },
      dataOption: {} as DataOption,
      run (cell, data) {
        cell.data.expose.run(data)
      }
    },
    mapOptions: {
      // 地图主题
      style: 'normal'
    },
    interactingSelect: {
      disableDefaultMovable: true,
      disableSelect: false,
      disableEvent: false
    },
    getAttrModules: () => {
      return [
        {
          title: '基本样式',
          group: 'Attrs',
          components: () => import('./components/BasicAttrs.vue'),
          solution: {}
        },
        {
          title: '操作',
          group: 'Attrs',
          components: () => import('../../components/NodeOperation.vue'),
          solution: {}
        },
        {
          title: '数据类型',
          group: 'Data',
          components: () => import('./components/DataType.vue'),
          solution: {}
        }
      ]
    }
  } as DataType
})
